From 8772053d90e8f4580795f9d07a67f5fdaca63211 Mon Sep 17 00:00:00 2001 From: Drew Parsons Date: Tue, 13 Oct 2026 12:08:50 +0200 Subject: [PATCH] Check for null pointer in vtkMatplotlibMathTextUtilities Forwarded: not-needed Check if image scalar pointer is null before accessing to avoid crash on s390x. Gbp-Pq: Name matplotlib_nullptr_s390x.patch --- Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx b/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx index 3e6b219f0..714723e5d 100644 --- a/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx +++ b/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx @@ -1023,6 +1023,12 @@ bool vtkMatplotlibMathTextUtilities::RenderOneCell(vtkImageData* image, int bbox return false; } + if (ptr == nullptr) + { + vtkErrorMacro("image returned null ScalarPointer."); + return false; + } + // Background, do not load python data if (row > pythonRowStart || col < pythonColStart || row <= pythonRowEnd || col >= pythonColEnd) -- 2.39.5